*******************************************************************************

*   IZA Covid Regressions & Visualization Replication		                   *
*   MASTER DO-FILE                                                             *

********************************************************************************

* 	Note: 	
*				The dofile does not strictly require setting up a current directory.
*				DoFile uses relative path starting from the point where zip file
*				is extracted
	
*				Directly executing the master dofile after extracting contents 
* 				from main ZIP file will display all results
	
*				Prepared using: Stata/SE 17.0 for Windows (64-bit) 
*								(Revision: 09 Nov 2022)


* Description:
*				The provided code reproduces all numbers provided in text in the
*				blog along with the main figure as well as the visualization in the 
*				final report.

*				The code is ordered in the same manner as numbers appear in text.
*				To make it easy to read, each code block is numbered and header
*				is provided to match with that within the blog text.


* The dofile has been ordered in sections as follows:
* 	PART 0: 	Select Sections to Run 
* 	PART 1: 	Install Packages
* 	PART 2: 	Run Regression to view numbers used in Blog
* 	PART 3: 	Run Code to replicate visualization within Blog
* 	PART 4: 	Run Code to replicate visualization within Final Report

********************************************************************************
*   PART 0: Select Sections to Run
********************************************************************************

* Note: Change value from 0 to 1 if you want to run the particular section

    local  packages     1 // Install user-written commands (One time only!)
    local  regression   1 // Run Regressions
    local  visual1 		1 // Replicate Visualization for application behavior
    local  visual2 		1 // Replicate Visualization for adlisting rate
	
********************************************************************************
*   PART 1: Install Packages used for blog post
********************************************************************************

	if `packages' {
		do 		"./Code/Analysis/00_setup.do" 
	}

	
********************************************************************************
*   PART 2: Run Regressions to replicate numbers
********************************************************************************

	if `regression' {
		do 		"./Code/Analysis/01_numbers.do" 
	}
	
	
********************************************************************************
*   PART 3: Generate the visualization seen in the Blog
********************************************************************************

	if `visual1' {
		do 		"./Code/Analysis/02_figure.do" 
	}
	
	
	
********************************************************************************
*   PART 3: Generate the visualization seen in the Blog
********************************************************************************

	if `visual2' {
		do 		"./Code/Analysis/03_figure.do" 
	}
		